package main.grammar;

public class Name {

	private String generatedBy;
	private String value;
	private Tokens tokens;

	private void generate() {
		Token generator = this.tokens.getReference(this.generatedBy);
		if (generator != null) {
			this.value = generator.generate();
		}
	}

	public Name(Tokens tokens, String generatedBy) {
		this.tokens = tokens;
		this.generatedBy = generatedBy;
		generate();
	}

	public String getValue() {
		return value;
	}

}
